import http from '@src/util/HttpUtil';

const prefix='/api/linkc';

// 获取目录
export function queryProductCatalogs(params={}){
  return http.get(`${prefix}/outside/superCode/product/queryProductCatalogs`,params);
}

// 选中某个目录后同步数据
export function syncCatalogInfo(params={}){
  return http.post(`${prefix}/outside/superCode/product/syncCatalogInfo`,params);
}

// 查询单个目录详情
export function queryProductSetting(params={}){
  return http.get(`${prefix}/outside/superCode/product/queryProductSetting`,params);
}

// 查询企业资料
export function queryCompanyInfo(params={}){
  return http.get(`${prefix}/outside/superCode/mobile/queryCompanyInfo`,params);
}

// 保存配置
export function modifyProductSetting(params={}){
  return http.post(`${prefix}/outside/superCode/product/modifyProductSetting`,params);
}

// 查询自助门户快捷入口
export function queryQuickInfo(params={}){
  return http.get(`${prefix}/outside/superCode/product/queryQuickInto`,params);
}

// 查询全部规则
export function querySettingRules(params={}){
  return http.get(`${prefix}/outside/superCode/rule/querySettingRules`,params);
}

// 查看规则详情
export function queryRuleInfo(params={}){
  return http.get(`${prefix}/outside/superCode/rule/queryRuleInfo`,params);
}

// 查询事件类型列表
export function queryEventType(params={}){
  return http.get(`${prefix}/outside/superCode/product/queryEventType`,params);
}

// 获取备件
export function queryRelParts(params={}){
  return http.get(`${prefix}/outside/superCode/mobile/queryRelParts`,params);
}

// 获取知识库
export function queryRelKnowledge(params={}){
  return http.get(`${prefix}/outside/superCode/mobile/queryRelKnowledge`,params);
}

// 保存模板
export function saveSuperCodeTemplate(params={}){
  return http.post(`${prefix}/outside/superCode/product/saveSuperCodeTemplate`,params);
}

// 查询租户下的产品二维码模板
export function getAllSuperCodeTemplate(params={}){
  return http.get(`${prefix}/outside/superCode/product/getAllSuperCodeTemplate`,params);
}

// 复制产品模板
export function copyTemplate(params={}){
  return http.get(`${prefix}/outside/superCode/product/copyTemplate`,params);
}
// 删除产品二维码模板
export function deleteTemplate(params={}){
  return http.get(`${prefix}/outside/superCode/product/deleteTemplate`,params);
}

// 获取所有产品字段
export function getShowFields(params={}){
  return http.get(`${prefix}/outside/superCode/product/getShowFields`,params);
}

// 插入产品二维码客服的兜底规则联系人员
export function insertBaseSupercodeCustomerProvider(params={}){
  return http.get(`${prefix}/outside/superCode/product/insertBaseSupercodeCustomerProvider`,params);
}

// 查询模板下的所有已关联产品类型（分页）
export function getAllProductCatalog(params={}){
  return http.get(`${prefix}/outside/superCode/product/getAllProductCatalog`,params);
}

// 查询模板下的所有已关联产品类型的id（包括父级）
export function getAllProductCatalogIds(params={}){
  return http.get(`${prefix}/outside/superCode/product/getAllProductCatalogIds`,params);
}

// 查询产品二维码客服的兜底规则联系人员
export function getBaseSupercodeCustomerProvider(params={}){
  return http.get(`${prefix}/outside/superCode/product/getBaseSupercodeCustomerProvider`,params);
}

/**
 * 产品类型取消关联模板
 * @param params
 *    templateId
 *    catalogIds
 * @returns {*}
 */
 export function cancelRelationProductCatalog(params){
  return http.post(`${prefix}/outside/superCode/product/cancelRelationProductCatalog`,params);
}

// 产品类型关联模板
export function relationProductCatalog(params){
  return http.post(`${prefix}/outside/superCode/product/relationProductCatalog`,params);
}

// 检测产品类型是否已关联模板
export function checkIsRelation(params){
  return http.post(`${prefix}/outside/superCode/product/checkIsRelation `,params);
}

// 获取权限
export function getUserAuth(){
  return http.get('/api/customer/outside/pc/catalog/getUserAuth');
}

/**
 * @description 查询当前已绑定的paas流程
 * @param {Object} 
 */
export function getSuperCodePaasInfo(params = {}) {
  return http.get('/api/linkc/outside/superCode/product/queryPaasInfo', params);
}